<?php

if (!function_exists('rend_section')) {

    function rend_section($template, $data = null) {
        if (is_array($data)) {
            extract($data);
        }

        $segments = explode('/', $template);

        $file_name = array_pop($segments);

        $path = implode('/', $segments);

        include FCPATH . 'application/views/' . $path . '/_' . $file_name . '.php';
    }

}

if (!function_exists('if_null')) {

    function if_null($value, $default = null) {
        return is_null($value) ? $default : $value;
    }

}
